mkdir /tmp/spotify_debundle
rm -rf /tmp/spotify_debundle/dist
cd /tmp/spotify_debundle

// curl https://open.scdn.co/static/web-player.0256f3d8.js --compressed > spotify.bundle.js
curl https://open.scdn.co/static/web-player.1474c65d.js --compressed > spotify.bundle.js

cat <<EOF > config.json
{
  "type": "webpack",
  "moduleAst": ["body", 0, "expression", "argument", "arguments", 0, "arguments", 0],
  "replaceRequires": "variable",
  "entryPoint": 0,
  "knownPaths": {
    "0": "./entrypoint",
    "322": "./index",

    "623": "./media/Session",
    "604": "./media/PlayerManager",
    "602": "./media/PSSHBox",
    "600": "./media/EMEManager",
    "619": "./media/Dealer",
    "594": "./media/Client",
    "598": "./media/Streamer",
    "595": "./media/Controller",
    "591": "./media/SpotifyConnection",

    "58": "./LoggingManager",
    "2": "./I18n",
    "88": "./http/HTTPStatus",
    "11": "./PromisePolyfill",
    "100": "./CookieManager",
    "12": "./reducers/12",
    "133": "./Base64"
  }
}
EOF

npm init --yes
npm i debundle
./node_modules/.bin/debundle -i spotify.bundle.js -o dist/ -c config.json

# git clone git@github.com:foo/bar.git git_repo
# cp -R dist/* git_repo/

# cd git_repo
# git add -u
# git commit -m "debundled"
# git push origin master
